//
//  CWShortVideoController.swift
//  SwiftTest
//
//  Created by 陈旺 on 2022/1/25.
//

import UIKit

/// 控制器
class CWShortVideoController: UIViewController {

    private lazy var container: CWShortVideoContainer = {
        let view = CWShortVideoContainer.init()
        return view
    }()

    override func viewDidLoad() {
        super.viewDidLoad()
        configureView()
    }

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        navigationController?.setNavigationBarHidden(true, animated: false)
    }

    override func viewWillDisappear(_ animated: Bool) {
        super.viewWillDisappear(animated)
        navigationController?.setNavigationBarHidden(false, animated: false)
    }

    private func configureView() {
        view.backgroundColor = .white
        configureContainer()
    }

    private func configureContainer() {
        let map: [String: UIView] = [
            "container": container
        ]
        map.addTo(view)
        view.withVFL("H:|[container]|", views: map)
        view.withVFL("V:|[container]|", views: map)
    }
}
